import request from '@/utils/request'

// 查询派出单位计划管理列表
export function listCompanyplan(query) {
  return request({
    url: '/grant/companyplan/list',
    method: 'get',
    params: query
  })
}
// 查询本单位计划管理列表
export function listSelfPlan(query) {
  return request({
    url: '/grant/companyplan/listSelfPlan',
    method: 'get',
    params: query
  })
}

// 查询派出单位计划管理详细
export function getCompanyplan(id) {
  return request({
    url: '/grant/companyplan/' + id,
    method: 'get'
  })
}

// 新增派出单位计划管理
export function addCompanyplan(data) {
  return request({
    url: '/grant/companyplan',
    method: 'post',
    data: data
  })
}

// 修改派出单位计划管理
export function updateCompanyplan(data) {
  return request({
    url: '/grant/companyplan',
    method: 'put',
    data: data
  })
}

// 删除派出单位计划管理
export function delCompanyplan(id) {
  return request({
    url: '/grant/companyplan/' + id,
    method: 'delete'
  })
}

// 导出派出单位计划管理
export function exportCompanyplan(query) {
  return request({
    url: '/grant/companyplan/export',
    method: 'get',
    params: query
  })
}
// 导出派出单位计划管理_按科目横表
export function exportForSubject(query) {
  return request({
    url: '/grant/companyplan/exportForSubject',
    method: 'get',
    params: query
  })
}
// 导出本单位派出计划
export function exportPlanForSubject(query) {
  return request({
    url: '/grant/companyplan/exportPlanForSubject',
    method: 'get',
    params: query
  })
}
// 生成派出单位科类计划
export function createComapnyPlan(data) {
  return request({
    url: '/grant/companyplan/createComapnyPlan',
    method: 'post',
    data: data
  })
}
// 获取派出单位计划_根据科目横表展示
export function getCompanyPlanForSubject(query) {
  return request({
    url: '/grant/companyplan/getCompanyPlanForSubject',
    method: 'get',
    params: query
  })
}
// 获取派出单位计划_根据科目横表展示_本单位
export function getCompanyPlanForSubjectSelf(query) {
  return request({
    url: '/grant/companyplan/getCompanyPlanForSubjectSelf',
    method: 'get',
    params: query
  })
}

export function deleteGrCompanyPlanByComId(data) {
  return request({
    url: '/grant/companyplan/deleteGrCompanyPlanByComId',
    method: 'post',
    data: data
  })
}
